#ifndef DATATYPE_H
#define DATATYPE_H
#include "room_global.h"
#include <string>

#define PLAYER_PORTRAIT_URL_LEN         1024
#define PLAYER_NAME_LEN                 32

#define INVALID_CHAIRID                 0xffff
#define INVALID_TABLEID                 0

struct _tag_setting_server_data
{
    unsigned short workThreadCount;
};

struct _tag_setting_net_data
{
    std::string listenHost;
    unsigned short listenPort;
};

struct _tag_setting_table_data
{
    unsigned short chairCount;
    std::string logicPath;
};

struct _tag_setting_database_data
{
    std::string dbHost;
    std::string dbUser;
    std::string dbPassword;
    std::string dbName;
    unsigned short dbPort;
};

// Player status
#define PS_FREE                     0
#define PS_SITDOWN                  1
#define PS_READY                    2
#define PS_GAMING                   3
#define PS_OFFLINE                  4

// Table status
#define TS_FREE                     0
#define TS_GAMEING                  1

struct _tag_player_data
{
    unsigned long   netKey;

    unsigned int    id;

    unsigned int    tableID;

    unsigned short  chairID;

    unsigned char   sex;

    unsigned char   status;

    long long       diamond;

    long long       gold;

    long long       experience;

    char            name[PLAYER_NAME_LEN+1];

    char            portrait[PLAYER_PORTRAIT_URL_LEN+1];
};


typedef struct _tag_setting_server_data ServerSettingData;
typedef struct _tag_setting_net_data NetSettingData;
typedef struct _tag_setting_table_data TableSettingData;
typedef struct _tag_setting_database_data DatabaseSettingData;
typedef struct _tag_player_data PlayerData;

#endif // ANDATATYPE_H
